<?php
include_once $_SERVER['DOCUMENT_ROOT'].'/functions/bdd/init.php';

function get_sources(){
	$bdd = bdd_init();
	
	$prep_get_sources = $bdd->prepare('SELECT * FROM messages WHERE cle=?');
	$prep_get_sources->execute(array('sources'));
	$sources = $prep_get_sources->fetch();	
	
	return $sources['value']; 
}

function set_sources($sources){
	$cle = 'sources';
	$bdd = bdd_init();
	
	$prep_set_sources = $bdd->prepare('UPDATE messages SET value = :value WHERE cle=:cle');
	$prep_set_sources->bindParam(':cle', $cle);
	$prep_set_sources->bindParam(':value', $sources);
	$prep_set_sources->execute();
}
?>
